﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace GreetingWCFService
{
    [DataContract]    
    public class GreetingData : INotifyPropertyChanged
    {
        #region Constructors
        
        public GreetingData()
        { }

        internal GreetingData(Guid id)
        {
            GreetingID = id;
        }

        #endregion Constructors
        #region INotifyPropertyChanged

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(string info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

        #endregion INotifyPropertyChanged
        #region Properties

        private Guid _greetingID = new Guid();
        [DataMember]
        public Guid GreetingID
        {
            get { return _greetingID; }
            private set 
            {
                if (value != _greetingID)
                {
                    _greetingID = value;
                    NotifyPropertyChanged("GreetingID");
                }
            }
        }

        private string _message = string.Empty;
        [DataMember]
        public string Message
        {
            get { return _message; }
            set
            {
                if (value != _message)
                {
                    _message = value;
                    NotifyPropertyChanged("Message");
                }
            }
        }
        
        private List<GraphicElementData> _graphicElements = new List<GraphicElementData>();
        [DataMember]
        public List<GraphicElementData> GraphicElements
        {
            get { return _graphicElements; }
            set
            {
                if (value != _graphicElements)
                {
                    _graphicElements = value;
                    NotifyPropertyChanged("GraphicElements");
                }
            }
        }

        #endregion Properties
    }
}
